<?php
/* @var $this GoodsController */
/* @var $model Goods */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'goods-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'goodsnum'); ?>
		<?php echo $form->textField($model,'goodsnum',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'goodsnum'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'typeid'); ?>
		<?php echo $form->listBox($model, 'typeid',  $goodsType, array('size'=>1) ); ?>
		<?php echo $form->error($model,'typeid'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'size'); ?>
		<?php echo $form->textField($model,'size',array('size'=>30,'maxlength'=>30)); ?>
		<?php echo $form->error($model,'size'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'unit'); ?>
		<?php echo $form->textField($model,'unit',array('size'=>10,'maxlength'=>10)); ?>
		<?php echo $form->error($model,'unit'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'price'); ?>
		<?php echo $form->textField($model,'price'); ?>
		<?php echo $form->error($model,'price'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'indate'); ?>
		<?php 
		$this->widget('zii.widgets.jui.CJuiDatePicker', array(
				'attribute'=>'indate',
				'model'=>$model,
				// additional javascript options for the date picker plugin
				'options'=>array(
						'showAnim'=>'fold',
						'dateFormat'=>'yy-mm-dd',
						'dayNames'=>array("日","一","二","三","四","五","六"),
						'dayNamesMin'=>array("日","一","二","三","四","五","六"),
						'monthNames'=>array("一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"),
						'maxDate'=>'0'
				),
				'htmlOptions'=>array(
						'style'=>'height:20px;'
				),
		));
		?>
		<?php echo $form->error($model,'indate'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'memo'); ?>
		<?php echo $form->textField($model,'memo',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'memo'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '添加' : '修改保存'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->